home *** CD-ROM | disk | FTP | other *** search
- /* token2.c: Parse input strings via strtokf() */
-
- #include <stdio.h>
- #include <ctype.h>
-
- char *strtokf(char *, int (*)(char));
- static int filter(char);
-
- main()
- {
- char s[81];
-
- while (gets(s))
- {
- char *tokp, *sp = s;
-
- while ((tokp = strtokf(sp,filter)) != NULL)
- {
- puts(tokp);
- sp = NULL;
- }
- }
- return 0;
- }
-
- static int filter(char c)
- {
- return isalpha(c);
- }
-
-